const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}
const isDev = process.env.NODE_ENV == 'development';
module.exports = {
    lintOnSave: false,
    productionSourceMap: false,
    publicPath: "./", // 构建好的文件输出到哪里
    configureWebpack() {
        return {
            // devtool: isDev ? 'none' : 'inline-cheap-module-source-map',
            devtool: isDev ? false : 'inline-cheap-module-source-map',
            resolve: {
                alias: {
                    '@': resolve('src'),
                },
            }
        }
    },
    devServer: {
        port: 8366,
        proxy: {
            '/release/api/base': {
               //  target: 'http://10.1.1.43:8365/',
                target: 'http://47.100.123.137:9365/',
            //  target: 'https://cheegon.cn:8365/',
                changeOrigin: true,
                pathRewrite: {
                    '^/release/api/base': ''
                }
            },
            '/release/api/upload': {
                //   target: 'http://10.1.1.43:8365/',
                target: 'http://47.100.123.137:9365/',
                //  target: 'https://cheegon.cn',
                changeOrigin: true,
                pathRewrite: {
                    '^/release/api/upload': ''
                }
            },
            '/test/api/base': {
                //  target: 'http://10.1.1.43:8365/',
                target: 'http://47.100.123.137:8365/',
                //  target: 'https://cheegon.cn:8365/',
                changeOrigin: true,
                pathRewrite: {
                    '^/test/api/base': ''
                }
            },
            '/test/api/upload': {
               //   target: 'http://10.1.1.43:8365/',
                target: 'http://47.100.123.137:8365/',
             //  target: 'https://cheegon.cn',
                changeOrigin: true,
                pathRewrite: {
                    '^/test/api/upload': ''
                }
            },
        },
    },
}
